import { Redis } from 'ioredis'
import '~/config'
export const redis = new Redis(
    process.env.REDIS_PORT ? Number(process.env.REDIS_PORT) : 6379,
    process.env.REDIS_HOST ?? '127.0.0.1',
    {
        password: process.env.REDIS_PASS,
        db: typeof process.env.REDIS_DB !== 'undefined' ? Number(process.env.REDIS_DB) : undefined,
    },
)
